-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(teams): resolve undefined variable error and add logging #6290
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6290 +/- ##
============================================
- Coverage 23.47% 23.47% -0.01%
+ Complexity 454 453 -1
============================================
Files 247 247
Lines 11708 11712 +4
Branches 2223 2222 -1
============================================
Hits 2749 2749
- Misses 8639 8643 +4
Partials 320 320
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/backport to stable5.0 |
/backport to stable4.7 |
* | ||
* @NoAdminRequired | ||
*/ | ||
public function getCircleMembers(string $circleId):JSONResponse { | ||
if (!$this->appManager->isEnabledForUser('circles') || !class_exists('\OCA\Circles\Api\v1\Circles')) { | ||
if (!class_exists('\OCA\Circles\Api\v1\Circles') || !$this->appManager->isEnabledForUser('circles')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question, why are we checking if the class exists? Would the check for isEnabledForUser not be sufficient enough to determine if the circles app is installed, enabled on the system and permitted for this user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original pr mentions a problem with Psalm #5420 (review) ;)
I haven't done any profiling but would expect, especially now with the flipped condition, a little performance gain for systems without circles.
isEnabledForUser does a lot (fetch the installed app versions for all apps, see if the app is installed, fetch the user session, fetch the groups for a user, see if the user has a group that the app is enabled for).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEnabledForUser does a lot (fetch the installed app versions for all apps, see if the app is installed, fetch the user session, fetch the groups for a user, see if the user has a group that the app is enabled for).
I checked the code... Thats not the case, I think the original author just didn't know there was a build in function to see if the app was enabled, and checked for the existence for the class instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats not the case
What is not the case?
adef3c9
to
56ca9af
Compare
Signed-off-by: Anna Larch <anna@nextcloud.com>
56ca9af
to
9d1688c
Compare
Signed-off-by: Anna Larch anna@nextcloud.com